import { defineComponent } from "vue";
import Field from "@/components/Field";
import { IFormItem } from "../../types";
import { IFormLink } from "./types";
export default defineComponent({
  name: "",
  props: {
    data: {
      type: String,
      default: "",
    },
    item: {
      type: Object as () => IFormLink,
      default: () => {
        return {};
      },
    },
  },
  setup(props) {
    const renderValue = (src: string) => {
      return <img src={src} class="w-[38px] h-[338px]" />;
    };
    return () => {
      return (
        <Field
          isLink={true}
          name={props.data || props.item.value}
          url={props.item.url}
          value={props.data}
          v-slots={{ value: renderValue }}
        />
      );
    };
  },
});
